import vue from "@vitejs/plugin-vue"
import { defineConfig, loadEnv, type ConfigEnv } from "vite"
import { resolve } from "path"

import vueJsx from "@vitejs/plugin-vue-jsx"

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	server: {
		host: "127.0.0.1",
		port: 8080,
		proxy: {
			"/api": {
				target: "https://www.dance365.com",
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/api/, ""),
			},
		},
	},
	resolve: {
		alias: {
			"@": resolve(__dirname, "src"),
		},
		extensions: [".ts", ".vue", ".js", ".jsx", ".tsx"],
	},
})
